﻿static void _rtu_timer_run(void)
{
	mb_rtu_timer_run(&mbObj);
}

static void _obj_init(void)
{
	mb_obj_init(&mbObj);
}

static void _mb_poll(void)
{
	mb_poll(&mbObj);
}

static uint8_t _stc_cmd_req(uint8_t CmdSite, mb_cmd_buff_type* pcmd)
{
	return mmb_stc_cmd_req(&mbObj, CmdSite, pcmd);
}

static uint8_t _dyna_cmd_req(mb_cmd_buff_type* pcmd)
{
	return mmb_dyna_cmd_req(&mbObj, pcmd);
}

static uint8_t _stc_cmd_del(uint8_t CmdSite)
{
	return mmb_stc_cmd_del(&mbObj, CmdSite);
}

static uint8_t _stc_cmd_os_req(uint8_t CmdSite, mb_cmd_buff_type* pcmd)
{
	return mmb_os_stc_cmd_req(&mbObj, CmdSite, pcmd);
}

static uint8_t _dyna_cmd_os_req(mb_cmd_buff_type* pcmd)
{
	return mmb_os_dyna_cmd_req(&mbObj, pcmd);
}

static uint8_t _stc_cmd_os_del(uint8_t CmdSite)
{
	return mmb_os_stc_cmd_del(&mbObj, CmdSite);
}

static uint8_t _cmd_ready_num(void)
{
	return mmb_cmd_ready_num(&mbObj);
}

static uint8_t _cmd_idle_num(void)
{
	return mmb_cmd_idle_num(&mbObj);
}

static void _cmd_clr(void)
{
	mmb_cmd_clr(&mbObj);
}

static void _dgus_poll(void)
{
	dgus_poll(&mbObj);
}

static void _dgusii_poll(void)
{
	dgusii_poll(&mbObj);
}

static void _vgus_poll(void)
{
	vgus_poll(&mbObj);
}

static void _vgus_page_set(uint16_t *page, void(*CallBack)(uint8_t, uint8_t))
{
	vgus_page_set(&mbObj, page, CallBack);
}

static void _vgus_pv_read(uint16_t *dat, uint16_t addr, uint16_t Len, void(*CallBack)(uint8_t, uint8_t))
{
	vgus_pv_read(&mbObj, dat, addr, Len, CallBack);
}

static void _vgus_pv_write(uint16_t *dat, uint16_t addr, uint16_t Len, void(*CallBack)(uint8_t, uint8_t))
{
	vgus_pv_write(&mbObj, dat, addr, Len, CallBack);
}


static void __rx_read(uint8_t dat)
{
	mb_data_rcv(&mbObj, dat);
}

static void __tx_write(void(*send)(uint8_t), uint8_t len)
{
	mb_data_send(&mbObj, send, len);
}

static void __tx_end(void)
{
	mb_send_end(&mbObj);
}


static const mb_fun_interface_type mb_fun =
{
	_rtu_timer_run,
	_obj_init,
	_mb_poll,
	_stc_cmd_os_req,
	_dyna_cmd_os_req,
	_stc_cmd_os_del,
	_stc_cmd_req,
	_dyna_cmd_req,
	_stc_cmd_del,
	_cmd_ready_num,
	_cmd_idle_num,
	_cmd_clr,
	_dgus_poll,
	_dgusii_poll,
	_vgus_poll,
	_vgus_page_set,
	_vgus_pv_read,
	_vgus_pv_write,
	//硬件层
	__rx_read,
	__tx_write,
	__tx_end,
};

